<?php $this->load->view('layout/header'); ?>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
<form name="form1" method="post" action="<?php echo b_url('config/sysmodule_action/').$info['sysmoduleid']?>" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
<div>
</div>
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    <span id="lblTitle">添加</span>模块
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    上级模块：
                </td>
                <td>
                    <span id="lblParent">
                        根结点
                        <?php
                            foreach ($node_list as $k => $v) {
                                echo ' > ' . $v['modulename'] . '  ';
                                echo '<input type="hidden" name="parentid" value="'.$v['sysmoduleid'].'">';
                            }
                        ?>
                    </span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    模块名称：
                </td>
                <td>
                    <input name="modulename" type="text" value="<?php echo $info['modulename']?>" id="modulename" />
                    <span id="modulename_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    模块标识：
                </td>
                <td>
                    <input name="modulevalue" type="text" value="<?php echo $info['modulevalue']?>" id="modulevalue" />
                    <span id="modulevalue_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    模块图标：
                </td>
                <td>
                    <input name="moduleico" type="text" value="<?php echo $info['moduleico']?>" id="moduleico" />
                    <span id="moduleico_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    管理URL：
                </td>
                <td>
                    <input name="moduleurl" type="text" value="<?php echo $info['moduleurl']?>" id="moduleurl" />
                    <span id="moduleurl_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    备注：
                </td>
                <td>
                    <textarea name="comment" rows="2" cols="20" id="txtComment" style="height:100px;width:200px;"><?php echo $info['comment']?></textarea>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    权限列表：
                </td>
                <td>
                    <table id="chkSysLimitIDs" border="0">
                        <?php 
                        if(!empty($syslimit)){ 
                            $limitidArr = explode(',', $info['syslimitids']);
                            $cnt = count($syslimit);
                            $num = ceil($cnt/10);
                            for($j=1;$j<=$num;$j++){
                                $t=0;
                                if($j==1){$s = 0;$k = 9;}
                        ?>
                        	<tr>
                            <?php for($i=$s;$i<=$k;$i++){ ?>
                        		<td>
                                    <?php if($syslimit[$i]['syslimitid']) { ?>
                                    <input id="chkSysLimitIDs_0" value="<?php echo $syslimit[$i]['syslimitid']?>" type="checkbox" name="syslimitid[]" <?php $res = _checkInarray($limitidArr,$syslimit[$i]['syslimitid']); if(TRUE == $res){?>checked="checked"<?php }?>/>
                                    <label for=""><?php echo $syslimit[$i]['limitname'];?></label>
                                    <?php } ?>
                                </td>
                            <?php $t++;}?>
                        	</tr>
                            
                        <?php 
                            if($t == 10 ){$s=10;$k=19;}
                            if($t == 20 ){$s=20;$k=29;}
                            }
                        } 
                        ?>
                    </table>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    排序号：
                </td>
                <td>
                    <input name="listid" type="text" num="true" value="<?php echo $info['listid']?$info['listid']:0;?>" id="listid" />
                    <span id="listid_tips" style="color:Red;display:none;">不能为空</span>
                    <span id="listid_num_tips" style="color:Red;display:none;">只能为数字</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    菜单显示：
                </td>
                <td>
                    <select name="isshow" id="drpIsShow">
                    	<option value="1" <?php if($info['isshow'] == 1){?>selected="selected"<?php }?>>显示</option>
                    	<option value="0" <?php if($info['isshow'] == 0){?>selected="selected"<?php }?>>隐藏</option>
                    </select>
                    <span id="RequiredFieldValidator9" style="color:Red;display:none;">请选择</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    状态：
                </td>
                <td>
                     <span id="radIsClose">
                        <input id="radIsClose_0" type="radio" name="isclose" value="1" <?php if($info['isclose'] == 1){echo 'checked="checked"';}?> /><label for="radIsClose_0">是</label>
                        <input id="radIsClose_1" type="radio" name="isclose" value="0" <?php if($info['isclose'] == 0 || empty($info)){echo 'checked="checked"';}?> /><label for="radIsClose_1">否</label>
                    </span>
                    <span id="RequiredFieldValidator5" style="color:Red;display:none;">请选择</span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">
                    &nbsp;
                </td>
                <td colspan="3">
                    <input type="submit" value="保存" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSave" />
                    <input type="button" value="返回" onclick="javascript:history.go(-1);" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
    </div>
    
<script type="text/javascript">
$('#form1').submit(function() {
	var is = true;
	if (!input_tips($('#modulename'))) {
	    is = false;
	}
	if (!input_tips($('#modulevalue'))) {
	    is = false;
	}
	if (!input_tips($('#moduleico'))) {
	    is = false;
	}
	if (!input_tips($('#moduleurl'))) {
	    is = false;
	}
	if (!input_tips($('#listid'))) {
	    is = false;
	}
	return is;
});
</script>
</body>
</html>

